<h1>Listing issues in volume <%= @current_volume.volume_number%></h1>

<table>
  <tr>
  <% for column in Issue.content_columns %>
    <th><%= column.human_name %></th>
  <% end %>
  </tr>
  
<% for issue in @issues_in_volume %>
  <tr>
  <% for column in Issue.content_columns %>
    <% if column.name == "status" %>
    <td><%=h issue.status_name %></td>
    <%else%>
    <td><%=h issue.send(column.name)%></td>
    <%end%>
  <% end %>
  <td><%= link_to 'List sections', { :action => 'list_sections_by_issue', :id => issue}  %></td>
    <td><%= link_to 'Show', :action => 'show_issue', :id => issue %></td>
    <td><%= link_to 'Edit', :action => 'edit_issue', :id => issue %></td>
    <td><%= link_to 'Destroy', { :action => 'destroy_issue', :id => issue }, :confirm => 'Are you sure?' %></td>
  </tr>
<% end %>
</table>


<br />

<%= link_to 'New issue', :action => 'new_issue' %>
